package adminlte.vo;

import lombok.Data;
import org.springframework.http.HttpStatus;

/**
 * @author ZHUFEIFEI
 */
@Data
public class ResponseData<T> {

    protected int status;

    protected T data;

    public ResponseData(HttpStatus status) {
        this.status = status.value();
    }

    public ResponseData(HttpStatus status, T data) {
        this.status = status.value();
        this.data = data;
    }

    public static <T> ResponseData<T> ok() {
        return new ResponseData<>(HttpStatus.OK);
    }

    public static <T> ResponseData<T> ok(T data) {
        return new ResponseData<>(HttpStatus.OK, data);
    }

}
